<?php


namespace app\api\controller;

use think\DB;
class Logo
{
    public function Logo(){
        //进行数据库查询nav
        $data = Db::name('banner')->alias('ba')
            ->join('attachment b', 'ba.thumb=b.id')
            ->field('ba.id,b.filepath')
            ->where('fenlei_id',11)
            ->select();
        foreach ($data as $key => &$v) {
            $v['filepath'] = 'http://' . $_SERVER['HTTP_HOST'] . $v['filepath'];
        }
        if ($data) {
            return json(['code' => 200, 'msg' => "成功", 'data' => $data]);
        } else {
            return json(['code' => 0, 'msg' => "失败", 'data' => []]);
        }

    }
}